package com.example.myapplication.Helper;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

import androidx.annotation.Nullable;

public class MemorandumHelper extends SQLiteOpenHelper{

    public MemorandumHelper(@Nullable Context context, @Nullable String name, @Nullable SQLiteDatabase.CursorFactory factory, int version) {
        super(context, name, factory, version);
    }

    //只在创建数据库时，创建一次这个表
        @Override
        public void onCreate(SQLiteDatabase db) {
            String sql = "create table memorandum(_id integer primary key autoincrement,title text,time text,infor text)";
            db.execSQL(sql);
        }

        @Override
        public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

        }
    }

